package com.phiture.erp.purchase.dal.mapper;

import java.util.*;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.phiture.erp.purchase.dal.entity.ErpPurchaseRequestDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 采购申请单 Mapper
 *
 * @author lekaihuai
 */
@Mapper
public interface ErpPurchaseRequestMapper extends BaseMapperX<ErpPurchaseRequestDO> {

    default int updateByIdAndStatus(Long id, Integer status, ErpPurchaseRequestDO updateObj) {
        return update(updateObj, new LambdaUpdateWrapper<ErpPurchaseRequestDO>()
                .eq(ErpPurchaseRequestDO::getId, id).eq(ErpPurchaseRequestDO::getStatus, status));
    }

}